function xiugai(did) {

    var dd=did;
    $.ajax({
        url: '/myspringboot/suppliser/findDiOne',
        type: 'post',
        dataType: "json",
        data:{
            diId:dd,
        },
        success:function (result) {
            var result = result.data;
            $(".modal22").empty();
            var diId = result.diId;
            //药品流水号
            var daNumber = result.diNumer;
            //通用名
            var diName = result.diName;
            //剂型
            var diForm = result.diForm;
            //规格
            var diSpecifications = result.diSpecifications;
            //单位
            var diUnit = result.diUnit;
            //装换系数
            var diCc = result.diCc;
            //生产企业
            var manufacturer = result.manufacturer;
            if (manufacturer != null) {
                var mfName = manufacturer.mfName;
            }
            var daName = null;
            var drugAtegory = result.drugAtegory;
            if (drugAtegory == null) {
                daName = "null"
            } else {
                //商品名称
                daName = drugAtegory.daName;
            }

            //批准文号
            var diApprovalNumber = result.diApprovalNumber;
            //批准文号有效期
            var diApprovalTerm = result.diApprovalTerm;
            //是否进口药
            var diImportDrugs = result.diImportDrugs;
            //包装材质
            var diMaterialQuality = result.diMaterialQuality;
            //包装单位
            var diBunit = result.diBunit;
            //最新零售价
            var diNewPrice = result.diNewPrice;
            //零售价出处
            var diRetailPrice = result.diRetailPrice;
            //质量层次
            var drugQualityLevel = result.drugQualityLevel;
            if (drugQualityLevel != null) {
                var dqlName = drugQualityLevel.dqlName;
            } else {
                 dqlName = "null"
            }
            //质量层次说明
                var diDqlexplain = result.diDqlexplain;
            //有无药品检验报告
            var diInspectionReport = result.diInspectionReport;

            //药品检验报告编号
            var diInspectionNumber = result.diInspectionNumber;
            //药品检验报告编号有效期
            var diInspectionTerm = result.diInspectionTerm;
            //产品说明

                var tr = '<table style=" border-collapse:collapse" ><tr colspan="2">'+
                    '<td >药品流水号</td>'+
                    '<td><input type="hidden" name="diId" value='+diId+'><input name="diNumer" id="drugNumber" class="LSNumer" onblur="findLSNumer()"value='+daNumber+' type=""></td>'+
                    '</tr><tr>'+
                    '<td>通用名</td>'+
                    '<td><input name="diName" id="diName" class="ypbh" onblur=""value='+diName+' type=""></td>'+
                    '<td>剂型</td>'+
                    '<td><input name="diForm" id="diForm" class="ypbh" onblur=""value='+diForm+' type=""></td>'+
                    '</tr><tr>'+
                    '<td>规格</td>'+
                    '<td><input name="diSpecifications" id="diSpecifications" class="ypbh" onblur=""value='+diSpecifications+' type=""></td>'+
                    '<td>单位</td>'+
                    '<td><input name="diUnit" id="diUnit" class="ypbh" onblur=""value='+diUnit+' type=""></td>'+
                    '</tr><tr>'+
                    '<td>转换系数</td>'+
                    '<td><input name="diCc" id="diCc" class="ypbh" onblur=""value='+diCc+' type=""></td>'+
                    '<td>生产企业</td>'+
                    '<td><input name="daSupplier" id="dcName" class="ypbh" onblur=""value='+mfName+' type=""></td>'+
                    '</tr><tr>'+
                    '<td>商品名</td>'+
                    '<td><input name="daName" id="state" class="ypbh" onblur=""value='+daName+' type=""></td>'+
                    '<td>中标价</td>'+
                    '<td><input name="diNewPrice" id="state" class="ypbh" onblur=""value='+diNewPrice+' type=""></td>'+
                    '</tr><tr>'+
                    '<td>批准文号</td>'+
                    '<td><input name="diApprovalNumber" id="state" class="ypbh" onblur=""value='+diApprovalNumber+' type=""></td>'+
                    '<td>批准文号有效期</td>'+
                    '<td><input name="diApprovalTerm" id="state" class="ypbh" onblur=""value='+diApprovalTerm+' type="date"></td>'+
                    '</tr><tr>'+
                    '<td>是否进口药</td>'+
                    '<td> <input type="radio" id="diImportDrugs1"  name="diImportDrugs"  value="1"';
                    if (diImportDrugs == 1){tr +='checked = checked';
                    }tr += '>'+'是'+'<input type="radio" id="diImportDrugs2" name="diImportDrugs"  value="0" ';
                    if (diImportDrugs == 0){tr +='checked = checked';
                    }tr += '>'+'否'+'</td>'+
                    '<td>包装材质</td>'+
                    '<td><input name="diMaterialQuality" id="state" class="ypbh" onblur=""value='+diMaterialQuality+'></td>'+
                    '</tr><tr>'+
                    '<td>包装单位</td>'+
                    '<td><input name="diBunit" value="'+diBunit+'"></td>'+
                    '<td>最新零售价</td>'+
                    '<td><input name="diNewPrice" id="state" class="ypbh" onblur=""value='+diNewPrice+' type=""></td>'+
                    '</tr><tr>'+
                    '<td>零售价出处</td>'+
                    '<td><input name="diRetailPrice" id="state" class="ypbh" onblur=""value='+diRetailPrice+' type=""></td>'+
                    '<td>质量层次</td>'+
                    '<td><input type="hidden" id="nidS1" name="diDqlName" value="'+dqlName+'"><select id="cengci12" style=" height: 25px; width: 160px;"></select></td>'+
                    '</tr><tr>'+
                    '<td>质量层次说明</td>'+
                    '<td><input name="diDqlexplain" id="state" class="ypbh" onblur=""value='+diDqlexplain+' type=""></td>'+
                    '<td>有无药品检验报告</td>'+
                    '<td> <input type="radio"  id="btn_re1" name="diInspectionReport"  value="1" ';
                    if(diInspectionReport==1){tr+='checked = checked';
                    }tr+=' >'+'有'+'<input id="btn_re2" type="radio" name="diInspectionReport"  value="0" ';
                    if(diInspectionReport==0){tr +='checked =checked';
                    }tr+='>'+'无'+'</td>'+
                    '</tr><tr>'+
                    '<td>药品检验报告编号</td>'+
                    '<td><input name="diInspectionNumber" id="state" class="ypbh" onblur=""value='+diInspectionNumber+' type=""></td>'+
                    '<td>药品检验报告编号有效期</td>'+
                    '<td><input name="diInspectionTerm" id="state" class="ypbh" onblur=""value='+diInspectionTerm+' type=""></td>'+
                    '</tr><tr>'+
                    '<td >产品说明</td>'+
                    '<td ><textarea class="form-control" rows="3"></textarea></td>'+
                    '</tr></table>'
                $(".modal22").append(tr);

        }
    })
    $(function  () {
        $.ajax({
            url: '/myspringboot/suppliser/findAllDQL',
            type: 'post',
            dataType: "json",
            success: function (result){
                var dqllist=result.data;
                var dcid1 = $("#nidS1").val();
                dcid.innerHTML = "<option value='0'>全部</option>";
                for (var i = 0; i < dqllist.length; i++) {
                    if (dcid1 == dqllist[i].dqlName) {
                        $("#cengci12").append("<option selected='selected' value='" + dqllist[i].dqlId + "'>" +dcid1 + "</option>")
                    } else {
                        $("#cengci12").append("<option value='" + dqllist[i].dqlId + "'>" + dqllist[i].dqlName + "</option>")
                    }
                }
            }
        })
    })
}
 function f() {
    var serialize = $("#abcd").serialize();
     $.ajax({
         url: '/myspringboot/CommodityController/updateDif',
         type: 'post',
         dataType: "json",
         data:serialize,
         success: function (result){
            var msg = result.msg;
            alert(msg);
             window.location.href = "weihucd.html";

         }
     })
 }


